window.onload = function () {
    function setFont() {
        var winW = document.documentElement.clientWidth
        var htmlFont = winW / 10;
        document.getElementsByTagName('html')[0].style.fontSize = htmlFont + 'px';
    }
    setFont();
    window.onresize = function () {
        setFont();
    }
}